package org.xdemo.example.remoteUI.entity;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.Random;

/**
 * Created by kz on 2017/8/18.
 */

//创建一个DEVICE实例

@Component

public class tOneDeviceMaker {
    public tHiDeviceParas theDevice;

    public tHiDeviceParas makeOneDevcie(){
        int count =0;
        tHiDeviceParas para = new tHiDeviceParas("CFGID="+ new Random().nextInt(500));

        for(int g =0;g<5;g++) {     //生成5组
            tOneGroup thegroup = new tOneGroup();
            thegroup.creatNewList(20,count);
            count += 20;
            para.addOneGroup(thegroup);

        }
        return  para;
    }

    public tOneDeviceMaker(){
        if(theDevice == null) {
            theDevice = this.makeOneDevcie();
        }
    }


}
